﻿using Microsoft.Extensions.DependencyInjection;

namespace HardStyle.SimpleEventBus.Registration
{
    internal static class CoreServiceRegistrar
    {
        public static void Registrar(IServiceCollection services, SimpleEventBusServiceConfiguration configuration)
        {
            services.AddTransient<ServiceFactory>(sp => sp.GetRequiredService);
            services.Add(new ServiceDescriptor(typeof(ISimpleEventBus), typeof(SimpleEventBus), configuration.Lifetime));
        }


    }
}
